<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1" charset="utf-8">
    <link rel="stylesheet" href="../javascripts/lib/jqm/jquery.mobile-1.4.3.min.css"/>
    <link rel="stylesheet" href="../stylesheets/main.css"/>
    <script src="../javascripts/jquery.form.js"></script>
    <script src="../javascripts/lib/jq/jquery-2.1.1.min.js"></script>
    <script src="../javascripts/lib/jqm/jquery.mobile-1.4.3.min.js"></script>
    <script type="text/javascript">
        /*$(document).on("pageshow","#pagetwo",function(){
            alert(<%=sum%>);
            $('#rc').html(<%=sum%>);
        });*/
    </script>
    <title><%=title%></title>
</head>
<body>
<div data-role="page" id="pubChatDetailPage">
    <div data-role="header">
        <a class="ui-btn ui-icon-back ui-btn-icon-left" href="#searchpage">返回</a>
        <h1>会话记录</h1>
    </div>
    <div class="ui-content" role="main">
        <script type="text/javascript">
            $(function() {
                $("#btnMore").click(function() {
                    loadData();
                });
            });
            function loadData(){
                var content = '<div style="white-space:pre-wrap; margin: 3px;"><span style="color: #4169E1;font-weight: 700;">答：&nbsp;</span></div>' +
                        '<div style="white-space:pre-wrap;" >&emsp;&emsp;加载出来的数据。。。</div>';
                $("#chatlist").append(content).listview('refresh');
            }

        </script>
        <ul id="listview" data-role="listview" data-inset="true" >
            <%if(messageList.length>0){%>
            <!--<messageList.forEach(function(msg){>-->

            <li>
                <%for(var i=0;i<messageList.length;i++){%>

                <div>
                    <%if(messageList[i].send_openid==diff){%>
                        <div style="white-space:pre-wrap; margin: 3px;"><span style="color: #32CD32;font-weight: 700;">问：&nbsp;</span></div>
                        <div style="white-space:pre-wrap;" >&emsp;&emsp;<%=messageList[i].sendcontent%></div>
                    <%}else{%>
                        <div style="white-space:pre-wrap; margin: 3px;"><span style="color: #4169E1;font-weight: 700;">答：&nbsp;</span></div>
                        <div style="white-space:pre-wrap;" >&emsp;&emsp;<%=messageList[i].sendcontent%></div>
                    <%}%>
                </div>
                <%}%>
                <div id="chatlist">

                </div>

            </li>

            <%}else{%>
            <li><div class="noorder">
                    您目前没有会话记录!
                </div></li>
            <%}%>
        </ul>
        <div id="moreDiv" style="margin-top: 20px;">
            <a  data-role="button" data-icon="refresh"  data-iconpos="left"  href="#pagetwo" data-rel="dialog" data-transition="slidedown">
                显示更多
            </a>
            <!--<a href="#" class="ui-btn ui-icon-delete ui-btn-icon-left">Left</a>

            <a id="btnMore" class="ui-btn ui-icon-refresh ui-btn-icon-left" href="#pagetwo" data-rel="dialog" data-transition="slidedown">显示更多</a>-->
            <!--<a href="#pagetwo" data-rel="dialog" data-transition="slidedown">Go to Page Two</a>-->
            <input id="reletCount" type="hidden" value="<%=sum%>"/>
        </div>

    </div>
</div>

</body>
</html>